<!-- 顶部开始 -->
<div class="container">
    <div class="logo">
        <a href="">信达养车</a></div>
    <div class="left_open">
        <a><i title="展开左侧栏" class="iconfont">&#xe699;</i></a>
    </div>
    <ul class="layui-nav left fast-add" lay-filter="">

    </ul>
    <ul class="layui-nav right" lay-filter="">
        <li class="layui-nav-item">
            <a href="javascript:;">{{$arr_admin['username']}}</a>
            <dl class="layui-nav-child">

                <dd>
                    <a onclick="login_out()">退出</a>
                </dd>
            </dl>
        </li>

    </ul>
</div>
<script>
    function login_out() {
        var $_url = '{{route('shop_login_out')}}';
        $.ajax({
            url:$_url,
            type:'get',
            dataType : "json",
            success:function(result){
                if(result.state === 0){
                    layer.msg(
                        "退出成功",
                        {time:1000},
                        function() {
                            //清除所有的localStorage
                            localStorage.clear();

                            location_redirect('{{route('shop_login')}}');
                        });
                }else{
                    layer.msg(result.msg, {time:2000,icon: 5});
                }

            }
        });
    }

</script>
<!-- 顶部结束 -->